#!/usr/bin/env python

from address_book_class import AddressBook
import sys, os

def init ( l, admin = 0 ):
	from liwe import parts

	a = AddressBook ( l )

	parts.add ( l.layman, [ "form" ] )

	l.layman.add_js ( "modules/address_book/js/address_book.js" )
	l.layman.add_css ( "modules/address_book/gfx/address_book.css" )

	l.layman.add_js_code ( "address_book.init ();" )

	if admin and int ( admin ):
		parts.add_wwl ( l.layman, [ "htmled" ] )
        	l.layman.add_css ( "modules/address_book/gfx/address_book.admin.css" )

		l.layman.add_js ( "modules/address_book/js/address_book.admin.js" )
		l.layman.add_js_code ( "address_book.admin.init ();" )
		#l.layman.add_js ( "/modules/news/js/news.admin.templates.js" )
	

	return ''
